<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<%@page import="ahxu.search.db.PageResults"%>
<%@page import="ahxu.search.db.FinalResult"%>
<%
	PageResults<FinalResult> result=(PageResults<FinalResult>)request.getAttribute("results");
	if(result==null) {
		response.sendRedirect("search_do.jsp");
		return;
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form id="form_test" action="search_do.jsp" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
	<tr>
		<td align="left" class="contecttitle">
		name:<input type="text" name="sName" value="<%=request.getSession().getAttribute("sName")==null?"":request.getSession().getAttribute("sName")%>">
		address:<input type="text" name="sAddress" value="<%=request.getSession().getAttribute("sAddress")==null?"":request.getSession().getAttribute("sAddress")%>"> 
		phone:<input type="text" name="sPhone" value="<%=request.getSession().getAttribute("sPhone")==null?"":request.getSession().getAttribute("sPhone")%>">
		<input type="submit" name="submit" value="search"/>
		<a href="index.jsp">show all</a>
		</td>
	</tr>
	<tr>
		<td>
		
		
		<table width="100%" border="1" cellpadding="1" cellspacing="1"
			class="table">
			<tr>
				<td class="th">name</td>
				<td class="th">address</td>
				<td class="th">phone</td>
			</tr>
			<%if(result.getResults().size()==0){ %>
			<TR>
				<TD colSpan=3 class="tdcontect"></TD>
			</TR>
			<% }else{
			for(FinalResult obj:result.getResults()){
			%> 
			<tr>
				<td align="left"><%=obj.getName() %></td>
				<td align="left"><%=obj.getAddress() %></td>
				<td class="tdcontect"><%=obj.getPhone() %></td>
			</tr>
			<%}
			} %>
		</table>
		
		</td>
	</tr>
	<tr>
		<td align="left" class="contecttitle">第<%=result.getCurrentPage() %>/<%=result.getPageCount() %>第 
		<%for(int i=1;i<=result.getPageCount();i++){ %>
		<a href="search_do.jsp?pageNo=<%=i %>"><%=i %></a>
		<%} %>
		</td>
	</tr>
</table>
</form>
<p><a href="index.jsp">返回主菜单</a></p>
</body>
</html>
